<template>
	<view :class="[ 'item_wrap', { column: isColumn } ]">
		<view class="item_left">
			<image :src="item.mainImage"  class="image"></image>
			<text>{{ item.totalTime }}</text>
		</view>
		<view class="item_right">
			<view class="text-ellipsis">{{ item.title }}</view>
			<view>
				<text class="iconfont icon-laoshi2"></text>
				<text>{{ item.nickName }}</text>
			</view>
			<view>
				<view>
					<block v-if="item.isFree === 0">
						<text>免费</text>
					</block>
					<block v-else>
						<text class="iconfont icon-moneybag"></text>
						<text>{{ item.priceOriginal }}</text>
					</block>

				</view>
				<view>
					<text class="iconfont icon-video"></text>
					<text>{{ item.studyTotal }} 人在学</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "l-list-item",
		props: {
			isColumn: { //是否图片与文字描述纵向排列（false 默认横向，true 纵向）
				type: Boolean,
				default: false
			},
			item: {
				type: Object,
				default: () => null
			},
			data() {
				return {

				};
			}
		}
	}
</script>

<style lang="scss">
	.item_wrap {
		display: flex;
		padding-top: 20rpx;
		.item_left {
			position: relative;

			image {
				width: 290rpx;
				height: 170rpx;
				border-radius: 14rpx;
			}

			text {
				position: absolute;
				bottom: 6rpx;
				right: 6rpx;
				font-size: 22rpx;
				color: #fff;
				padding: 2rpx 10rpx;
				background: rgba(0, 0, 0, .3);
				border-radius: 20rpx;
			}
		}

		.item_right {
			padding-left: 20rpx;
			font-size: 26rpx;

			&>view:first-of-type {
				height: 70rpx;
				font-weight: 700;
			}

			&>view:nth-of-type(2) {
				font-size: 24rpx;
				color: $mxg-text-color-grey;
				margin: 14rpx 0 10rpx;
			}

			&>view:last-of-type {
				display: flex;
				justify-content: space-between;
				align-items: center;
				color: $mxg-color-orange;

				&>view:last-child {
					font-size: 22rpx;
					color: #000;
				}
			}
		}


	}
</style>
